package com.cn.test1.service;


import com.cn.test1.data.NavData;
import com.cn.test1.model.NavModel;

import java.util.ArrayList;
import java.util.List;

public class NavService {

    public List<NavModel> getNavModelList() {
        List<NavModel> list = new ArrayList<>();//新创建一个数组用来存放数据层的数据
        NavData navData = new NavData();
        for(int i = 0; i<navData.navtitles.length; i++){//遍历数组
            NavModel navModel = new NavModel();
            navModel.setHrefs(navData.hrefs[i]);
            navModel.setNavtitles(navData.navtitles[i]);
            list.add(navModel);
        }
        return list;
    }
    public List<NavModel> getNavModelListTwo(){
        List<NavModel> listtwo = new ArrayList<>();//新创建一个数组用来存放数据层的数据
        NavData navData = new NavData();
                for(int j = 0; j<navData.navtitlestwo.length; j++){
            NavModel navModel = new NavModel();
            navModel.setNavtitlestwo(navData.navtitlestwo[j]);
            listtwo.add(navModel);
        }
                return listtwo;
    }
}